<template>
  <div class="form-layout">
    <!--左侧导航-->
    <div class="nav-left">
      <customAnchor
        :itemList="[
          { name: 'box-base', title: '基础信息' },
          { name: 'box-yb', title: '医保信息' },
        ]"
      />
    </div>
     <!--表单区域-->
     <div class="form-right" ref="formRight">
      <customForm :data="form" :rules="propRules" ref="editForm" :disabled="propReadonly">
        <template #content>
          <div id="box-base" class="box-title">基础信息</div>
          <customFormItem label="收费列表名称" name="name" :parent="_self" :form="form" />
          <customFormItem label="收费编码" name="chargeCode" :parent="_self" :form="form" />
          <customFormItem label="HIS编码" name="hisCode" :parent="_self" :form="form" />
          <customFormItem label="HIS名称" name="hisName" :parent="_self" :form="form" />
          <customFormItem label="成人价格" name="pricePatientAdult" :parent="_self" :form="form"  :type="constCommon.formItemType.inputNumber.name"/>
          <customFormItem label="儿童价格" name="pricePatientChild" :parent="_self" :form="form"  :type="constCommon.formItemType.inputNumber.name"/>
          <customFormItem label="HIS单位" name="hisUnit" :parent="_self" :form="form" />
          <customFormItem label="拼音码" name="inputCode" :parent="_self" :form="form" />

          <div id="box-yb" class="box-title">医保信息</div>
          <customFormItem label="国家目录编码" name="nationalCode" :parent="_self" :form="form" />
          <customFormItem label="国家医保名称" name="nationalName" :parent="_self" :form="form" />
        </template>
      </customForm>
    </div>
  </div>
</template>

<script>
import customAnchor from '@/components/custom/form/customAnchor.vue'

export default {
  data() {
    return {
      form: {},
      viewData: {}
    }
  },
  methods: {  },
  created() {
    this.$emit('event-register', {
      validate: (callback) => {
        return this.$refs.editForm.validate(callback)
      },
      beforeSave: () => {
        this.$emit('data-callback', this.form)
        return true
      },
      afterMove: (formData, initData) => {
        this.form = global.utils.jsonClone(formData)

        // 设置switch 元素默认值
      },
      afterSave: () => {  },
      beforeDelete: () => {
        return true
      },
      afterDelete: () => {
      },
      beforeFlow: (flowButtonKey) => {
        return true
      },
      afterFlow: (flowButtonKey) => {
      },
      beforeClose: () => {
        return true
      }
    })
  },
  props: {
    propParent: Object,
    propInitData: Object,
    propPrimaryKey: String,
    propDictionaries: Object,
    propCurrentRow: Object,
    propViewFormData: Object,
    propReadonly: Boolean,
    propStatus: String,
    propRules: Object
  },
  components: {
    customAnchor
  },
  computed: {
  }
}
</script>
